angular.module('HeraldApp', ['ionic','HeraldApp.config','HeraldApp.services'])

.config(function($stateProvider, $urlRouterProvider,$ionicConfigProvider) {
    // $ionicConfigProvider.tabs.position('bottom');

    $stateProvider
    //index
    .state(
        "index",{
            url:"/herald",
            abstract:true,
            templateUrl:"pages/index/menu.html"
        })
    .state(
        "index.home",
        {
            url:"/home",
            views:{
                "home":{
                    templateUrl:"pages/index/home.html",
                    controller:"HomeCtrl"
                }
            }
        })
    .state(
        "index.state2",
        {
            url:"/state2",
            views:{
                "home":{
                    templateUrl:"pages/index/state2.html",
                    controller:"MyCtrl"
                }
            }
        })
    //login
    .state(
        "login",{
            url:"/login",
            templateUrl:"pages/auth/login.html",
            controller:"LoginCtrl"
        })
    //register
    .state(
        "register",{
            url:"/register",
            templateUrl:"pages/auth/register.html",
            controller:"registerCtrl"
        })
    //yuyue
    .state(
        "yuyue",{
            url:"/yuyue",
            cache: false,
            abstract:true,
            templateUrl:"pages/yuyue/menu.html",
            controller:"yuyueBeforeCtrl"
        })
    .state(
        "yuyue.home",
        {
            url:"/home",
            views:{
                "yuyue-home":{
                    templateUrl:"pages/yuyue/home.html",
                    controller:"yuyueCtrl",
                }
            }
        })
    .state(
        "yuyue-new",
        {
            url:"/yuyue/new",
            cache: false,
            templateUrl:"pages/yuyue/new.html",
            controller:"yuyueNewCtrl"
        })
    .state(
        "yuyue.My",
        {
            url:"/my",
            views:{
                "yuyue-my":{
                    templateUrl:"pages/yuyue/my.html",
                    controller:"yuyueMyCtrl"
                }
            }
        });
    $urlRouterProvider.otherwise('/herald/home');
})
.controller('MyCtrl', function($scope,$state) {
     
})
;